#include <bits/stdc++.h>
// 2025/02/05
// tag: 
// Author: Zhang Muen
using namespace std;

using int64 = int64_t;

int n, dp[41][821];

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    cin >> n;
    if (n * (n + 1) % 4 != 0){
        cout << 0;
        return 0;
    }
    dp[0][0] = 1;
    for (int i = 1; i <= 40; i++) {
        for (int j = 1; j <= n * (n + 1) / 2; j++){
            dp[i][j] = dp[i - 1][j];
            if (j >= i)
                dp[i][j] += dp[i - 1][j - i];
        }
    }
    cout << dp[n][n * (n + 1) / 4];
    return 0;
}